﻿using AviewLightSource;
using FinalTestMachine.Connect;
using FinalTestMachine.Motion.Product;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace FinalTestMachine.Motion.Process
{
    /// <summary>
    /// 工位二测试
    /// </summary>
    public class SecondTestStation : Process_TestStationBase
    {
        public static readonly SecondTestStation Cur = new SecondTestStation();

        private SecondTestStation() : base(SiteConnectManager.Cur.GetCommunicationHelper(2), "工位二", 1)
        {
        }

        public static SecondTestStation CreateInstance()
        {
            return Cur;
        }

        public override bool AxiOrCylinderToWorkPos()
        {
			Aixs.Site2.Aix_Site2_RelayMirror.Cur.WorkPos.Mov();
			Sleep(100);
			Aixs.Site2.Aix_Site2_PlaneSourceLift.Cur.WorkPos.Mov();
			return true;
        }

        public override bool AxiOrCylinderToWaitPos()
        {
			Aixs.Site2.Aix_Site2_PlaneSourceLift.Cur.WaitPos.Mov();
			Sleep(100);
			Aixs.Site2.Aix_Site2_RelayMirror.Cur.WaitPos.Mov();
			return true;
        }

        public override bool OtherActionBeforeExit()
        {
            return true;
        }

        public override ProductTestStation GetCurrentStation()
        {
            return CurrentProduct?.GetTestStation(2);
        }

        public override ProductTestStation GetLastStation()
        {
            return CurrentProduct?.GetTestStation(1);
        }

    }
}